package hadoop.mapreduce.mapjoin;

import org.apache.hadoop.io.Writable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class TableBean implements Writable {

    private String id; //订单id
    private long amount; //商品数量
    private String pName; //商品名称

    public void write(DataOutput out) throws IOException {
        out.writeUTF(id);
        out.writeLong(amount);
        out.writeUTF(pName);
    }

    public void readFields(DataInput in) throws IOException {
        id=in.readUTF();
        amount=in.readLong();
        pName=in.readUTF();
    }

    @Override
    public String toString() {
        return id+"\t"+pName+"\t"+amount;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public long getAmount() {
        return amount;
    }

    public void setAmount(long amount) {
        this.amount = amount;
    }

    public String getpName() {
        return pName;
    }

    public void setpName(String pName) {
        this.pName = pName;
    }

}
